﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using NHibernate;

using BEGDC.Utility.NHibernate;
using BEGDC.Office.Interface;
using BEGDC.Office.Library;
using BEGDC.MIS.Office.Excel;

namespace BEGDC.MIS.Office.Service
{
    class SampleData : FixedExcelService
    {
        public SampleData(ISessionFactory sessionFactory)
        {
            this.Factory = sessionFactory;
        }

        protected override string TableName
        {
            get
            {
                return "KnowOthersInfoData";
            }
        }

        protected override string ServiceName
        {
            get
            {
                return "KnowOthersInfoData";
            }
        }

        public override DataSet GetDataFromDB(string strCondition)
        {
            DataSet result = new DataSet();
            using (ISession session = Factory.OpenSession())
            {
                string sql = "Select * From KnowOthersInfoData Where " + strCondition;
                result.Tables.Add(DAO.ExecuteDataTable(session, sql));
            }
            return result;
        }
    }
}
